﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CompositeDesignPattern
{
    class Program
    {
        static void Main(string[] args)
        {
            DocumentParagraph pg1 = new DocumentParagraph("Page 1");
            DocumentParagraph pg2 = new DocumentParagraph("Page 2");
            DocumentParagraph pg3 = new DocumentParagraph("Page 3");
            DocumentParagraph pg4 = new DocumentParagraph("Page 4");

            DocumentChapter chp1 = new DocumentChapter(1);
            chp1.Add(pg1);
            chp1.Add(pg2);

            chp1.Write();

            DocumentChapter chp2 = new DocumentChapter(2);
            chp2.Add(pg3);
            chp2.Add(pg4);

            chp2.Write();

            Console.ReadKey();
        }
    }
}
